I've discovered my problem. I needed to define 3 different HDCs and PAINTSTRUCTs.